const carList = {
  namespaced:true,
  state:{
    list:[]
  },
  mutations :{
    add(state,obj){
      let index = state.list.findIndex(i=>i.name==obj.name)
      if(index == -1){
        state.list.push({
          ...obj,
          count:1
        })
      }else {
        state.list[index].count++;
      }
    }
  },
  actions: {
  },
  modules: {
  }
}
export default carList